﻿<%@ Page %>
<%@ Register TagPrefix="crm" Namespace="Mysoft.Crm.Controls" Assembly="Mysoft.Crm.Application.Components" %>
<html>
<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"/>
<title>编辑过滤标准</title>
<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
<link rel="stylesheet" type="text/css" href="/_common/styles/select.css">
<link rel="stylesheet" type="text/css" href="/_common/styles/dialogs.css">
<link rel="stylesheet" type="text/css" href="/_tools/search/search.css">
<style>

	TD.gridspacer
	{
		width:				5px;
	}

	TD.gridheader
	{
		padding-left:		8px;
	}

	TABLE.gridheader
	{
		background-color:	#e9e7d7;
		background-image:	url(/_grid/imgs/bar_bk.gif);
		font-size:			11px;
		width:				100%;
		height:				22px;
		border:				1px solid #dbdac9;
		border-bottom:		1px solid #c5c1b1;
	}

</style>
<script language="JavaScript" src="/_controls/settings.aspx"></script>
<script language="JavaScript" src="/_controls/number/number.js"></script>
<script language="JavaScript" src="/_common/scripts/global.js"></script>
<script language="JavaScript" src="/_controls/lookup/lookupdialogs.js"></script>
<script language="JavaScript" src="/_tools/search/search.js"></script>
<script language="JavaScript" src="/_controls/datetime/date.js"></script>
<script language="JavaScript" src="/_controls/lookup/lookup.js"></script>
<script language="JavaScript" src="/_controls/util/util.js"></script>

<script language="JavaScript">

	function window.onload()
	{
		window.dialogArguments.bShowHeaders = false;
		loadSearch(window.dialogArguments);
	}
	
	function Ok()
	{	
		var sFilter = buildFilterXml(true);
		
		if(sFilter != null)
		{
			var oReturn = new Object();
			oReturn.Filter = sFilter;
			window.returnValue = oReturn;
			window.close();
		}

	}
	
	function Reset()
	{	
		var oArgs = new Object();
		
		oArgs.iNumFilters	= 5;
		oArgs.sObjectType	= window.dialogArguments.sObjectType;
		oArgs.sObjectName	= window.dialogArguments.sObjectName;
		oArgs.sLayoutXml	= "";
		oArgs.sIdFieldName	= window.dialogArguments.sIdFieldName;
		oArgs.bShowHeaders	= false;
	
		loadSearch(oArgs);
	}
	
	function SelectAll(o)
	{
		for(var i=0; i<tblSearch.rows.length; i++)
		{
			tblSearch.rows[i].cells[0].children[0].checked = o.checked;
		}
	}

</script>
</head>
<body>

	<table cellspacing="0" cellpadding="8" width="100%" height="100%">
		<tr>
			<td class="header">
				<div class="header">配置标准</div>
				<div class="headerdesc">配置这个视图用到的过滤和搜索标准。</div>
			</td>
		</tr>
		<tr>
			<td class="main">
				<table height="20" cellpadding="0" cellspacing="0" class="gridheader">
					<tr>
						<td width="20" style="padding-left: 4px;"><input type="checkbox" class="checkbox" onclick="SelectAll(this);"></td>
						<td class="gridspacer"><img src="/_grid/imgs/bar_line.gif"></td>
						<td width="150" class="gridheader">字段</td>
						<td class="gridspacer"><img src="/_grid/imgs/bar_line.gif"></td>
						<td width="150" class="gridheader">条件</td>
						<td class="gridspacer"><img src="/_grid/imgs/bar_line.gif"></td>
						<td width="155" class="gridheader">值</td>
						<td class="gridspacer"><img src="/_grid/imgs/bar_line.gif"></td>
						<td width="10">&nbsp;</td>
					</tr>
				</table>
				<div id="divSearch" style="height:150;overflow-y:scroll;">
					<crm:Search id="crmSearch" NumberFilters="5" runat="server"/>
				</div>
				<button id="btnAddRow" onclick="AddSearchRow();" style="width:100px" title="点击这里增加一个新行">增加行</button>
				&nbsp;
				<button id="btnDeleteRow" onclick="DeleteSearchRow();" style="width:100px" title="点击这里删除选中行">删除行</button>	
			</td>
		</tr>
		<tr>
			<td class="buttons">
				<button id='btnReset' onclick='Reset();' title="点击这里重置视图的过滤标准">重置</button>
				&nbsp;
				<button id="btnDialogOk" onclick="Ok();">确定</button>
				&nbsp;
				<button onclick="window.close();">取消</button>
			</td>
		</tr>
	</table>

</body>
</html>
